﻿@using Website.CRUDServices
@using Location = Website.Models.Domain.Location
@{
    this.ViewBag.Title = "Søgning - Forretningsudvikling";
    this.Layout = "~/Views/_Shared/_Layout.cshtml";
    List<Project> Projects = this.ViewData["Projects"] as List<Project> ?? new List<Project>();
    List<Location> Locations = this.ViewData["Locations"] as List<Location> ?? new List<Location>();
    List<Profile> Profiles = this.ViewData["Profiles"] as List<Profile> ?? new List<Profile>();
    List<Topic> Topics = this.ViewData["Topics"] as List<Topic> ?? new List<Topic>();
}

<h2>@ViewBag.Title</h2>

<script>
    $(function() {
        $('#Profiles').multiSelect();
        $('#Topics').multiSelect();
    });
</script>

@using (this.Html.BeginForm("BusinessDevelopmentSearchResult", "Reports"))
{
    @* Tilføjer søge-partial *@
    @Html.Partial("~/Views/Reports/_SearchDefaultFields.cshtml", Projects)

    <div class="formBullet">Profiler som skal indgå:</div>
    <div class="formEntry">
        <select name="Profiles" id="Profiles" multiple="multiple">
            @foreach (Profile prof in Profiles)
            {
                <option value="@prof.ID">@prof.Name</option>
            }
        </select>
    </div>

    <div class="formBullet">Lokation:</div>
    <div class="formEntry">
        <select name="Location" id="Location">
            <option value="@Guid.Empty.ToString()" selected="selected"></option>
            @foreach (Location loc in Locations)
            {
                <option value="@loc.ID">@loc.Name</option>
            }
        </select>
    </div>

    <div class="formBullet">Specificeret snak:</div>
    <div class="formEntry">
        <select multiple="multiple" name="Topics" id="Topics">
            @foreach (Topic top in Topics)
            {
                <option value="@top.ID">@top.Title</option>
            }
        </select>
    </div>
    <div class="buttonHolder">
        <input type="submit" value="Søg" /></div>
}